#include<stdio.h>
#include<stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include<unistd.h>

int main()
{
  close(1);
  int fd1 = open("log1.txt",O_WRONLY | O_CREAT | O_TRUNC,0666);
  printf("fd1: %d\n",fd1);
  fprintf(stdout,"helloworld\n");
  fflush(stdout);
  close(fd1);
 // fclose(stdout);
  return 0;
}
